<#import "../../layout.html" as c>
    <#import "../../list_layout.html" as list>
        <#assign alertList = []/>
        <@c.html title="我的订单列表">
        <!-- ================== 开始页面级CSS调用 ================== -->
        <link href="${pluginsRoot}bootstrap-wizard/css/bwizard.min.css" rel="stylesheet"/>
        <!-- 日历控件 -->
        <link href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/WdatePicker.css" rel="stylesheet"/>
        <link href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/default/datepicker.css" rel="stylesheet"/>
        <!-- ================== 结束页面级CSS调用 ================== -->
        <@list.html title="我的订单列表" subTitle="我的订单列表" alertList=alertList permi="sys:myOrder:save" addBtn=true searchHint="请输入客户ID进行搜索">

        <!-- 开始用户权限参数 -->
        <@shiro.hasPermission name="sys:myOrder:edit">
        <input type="hidden" id="editPermi" value="1"/>
    </@shiro.hasPermission>
    <@shiro.hasPermission name="sys:myOrder:del">
    <input type="hidden" id="delPermi" value="1"/>
</@shiro.hasPermission>
<!-- 结束用户权限参数 -->
<input type="hidden" value="${admin.userId}" id="userId">
<input type="hidden" value="${admin.roleId}" id="roleId">

<!-- 开启回填点买信息模态窗口 -->
<div class="modal fade" id="backFillModal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">订单信息<a class="btn btn-info btn-xs m-l-10" role="button" data-toggle="collapse" href="#scramble" aria-expanded="true" title="操作提示"> <i class="fa fa-exclamation"></i> &nbsp;提示 </a> </h4>
                <ul class="text-info p-b-15 p-l-15 collapse in" role="tabpanel" id="scramble">
                    <li class="m-b-3">恭喜您抢到订单，请核对信息并且填写股票成交信息！</li>
                </ul>
            </div>
            <div class="modal-body">
                <form id="backFillForm" class="form-horizontal" autocomplete="off" action="${adminRoot}order/back.json" method="post" data-parsley-validate="true">
                    <input type="hidden" name="id" class="orderId">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">股票代码&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control invite-code" id="equityCode" readonly title="股票代码"/>
                        </div>
                        <div class="col-sm-3 control-span">
                            <input class="form-control invite-copy" id="copy-stock-code" type="button" value="复制代码" title="复制股票代码" data-clipboard-action="copy" data-clipboard-target=".invite-code"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">股票数量&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control inviteNumber" id="buyNumber" readonly title="股票数量"/>
                        </div>
                        <div class="col-sm-3 control-span">
                            <input class="form-control invite-copy" type="button" value="复制数量" data-clipboard-action="copy" data-clipboard-target=".inviteNumber" title="复制股票数量"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">股票名称&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control" id="equityName" readonly title="股票名称"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">点买价格&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control" id="buyPrice" readonly title="点买价格"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">成交价格&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control" id="buyDealPrice" name="buyDealPrice" required title="成交价格" maxlength="11"
                                   onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">成交数量&nbsp;: </label>
                        <div class="col-sm-7 control-span">
                            <input class="form-control" id="buyDealNumber" name="buyDealNumber" required title="成交数量" maxlength="11"
                                   onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"
                                   onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"/>
                        </div>
                    </div>
                </form>
                <form id="flowForm" autocomplete="off" action="${adminRoot}order/flow.json" method="post" data-parsley-validate="true">
                    <input type="hidden" name="id" class="orderId">
                </form>
            </div>
            <div class="modal-footer">
                <a href="javascript:;" class="btn btn-white" data-loading-text="Loading..." nc-ajax-submit-target="flowForm" nc-ajax-submit>流单</a>
                <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="backFillForm" nc-ajax-submit>确认提交</a>
            </div>
        </div>
    </div>
</div>
<!-- 结束回填点买信息模态窗口 -->

<!-- 开启平仓操作模态窗口 -->
<div class="modal fade" id="closePositionModal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> 平仓 <a class="btn btn-info btn-xs m-l-10" role="button" data-toggle="collapse" href="#OperationTipsPingcang" aria-expanded="true" title="操作提示"> <i class="fa fa-exclamation"></i> &nbsp;提示 </a> </h4>
            </div>
            <div class="modal-body">
                <ul class="text-info p-b-15 p-l-15 collapse in" role="tabpanel" id="OperationTipsPingcang">
                    <li class="m-b-3">点击确认修改待平仓的订单为平仓中</li>
                </ul>
                <form id="closePositionForm" autocomplete="off" action="${adminRoot}order/goPingcang.json" method="post" data-parsley-validate="true">
                    <input type="hidden" name="id" class="oId">
                </form>
            </div>
            <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="closePositionForm" nc-ajax-submit>确认提交</a> </div>
        </div>
    </div>
</div>
<!-- 结束平仓操作模态窗口 -->

<!-- 开启点卖模态窗口 -->
<div class="modal fade" id="sellModal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> 点卖 <a class="btn btn-info btn-xs m-l-10" role="button" data-toggle="collapse" href="#OperationTipsSell" aria-expanded="true" title="操作提示"> <i class="fa fa-exclamation"></i> &nbsp;提示 </a> </h4>
            </div>
            <div class="modal-body">
                <ul class="text-info p-b-15 p-l-15 collapse in" role="tabpanel" id="OperationTipsSell">
                    <li class="m-b-3">请检查股票名称和股票代码，填写卖出价格和卖出数量</li>
                </ul>
                <form id="sellForm" autocomplete="off" action="${adminRoot}order/pingcang.json" method="post" data-parsley-validate="true">
                    <input type="hidden" name="id" class="oId">
                    <div class="form-group">
                        <label class="control-label">股票代码&nbsp;: </label>
                        <input type="text" class="form-control" id="equityCode_sell" disabled/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">股票名称&nbsp;: </label>
                        <input type="text" class="form-control" id="equityName_sell" disabled/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">买入数量&nbsp;: </label>
                        <input type="text" class="form-control" id="buyDealNum" disabled/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">买入价格&nbsp;: </label>
                        <input type="text" class="form-control" id="buyDealPrice_sell" disabled/>
                    </div>

                    <div class="form-group">
                        <label class="control-label">卖出数量&nbsp;: </label>
                        <input type="text" class="form-control" name = "sellDealNumber" data-parsley-required="true"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">卖出价格&nbsp;: </label>
                        <input type="text" class="form-control" name = "sellDealPrice" data-parsley-required="true"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="sellForm" nc-ajax-submit>确认提交</a> </div>
        </div>
    </div>
</div>
<!-- 结束点卖模态窗口 -->

<!-- 开启审核模态窗口 -->
<div class="modal fade" id="verifyModal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> 审核 <a class="btn btn-info btn-xs m-l-10" role="button" data-toggle="collapse" href="#OperationTipsVerify" aria-expanded="true" title="操作提示"> <i class="fa fa-exclamation"></i> &nbsp;提示 </a> </h4>
            </div>
            <div class="modal-body">
                <ul class="text-info p-b-15 p-l-15 collapse in" role="tabpanel" id="OperationTipsVerify">
                    <li class="m-b-3">请仔细核对信息</li>
                </ul>
                <form id="verifyForm" autocomplete="off" action="${adminRoot}order/verify.json" method="post" data-parsley-validate="true">
                    <input type="hidden" name="id" class="oId">
                    <div class="form-group">
                        <label class="control-label">股票代码&nbsp;: </label>
                        <input type="text" class="form-control" id="equityCode_verify" data-parsley-required="true" disabled/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">股票名称&nbsp;: </label>
                        <input type="text" class="form-control" id="equityName_verify" data-parsley-required="true" disabled/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">买入数量&nbsp;: </label>
                        <input type="text" class="form-control" id="buyDealNum_verify" name="dealNumber" data-parsley-required="true"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">买入价格&nbsp;: </label>
                        <input type="text" class="form-control" id="buyDealPrice_verify" name="buyDealPrice" data-parsley-required="true" />
                    </div>
                    <div class="form-group">
                        <label class="control-label">卖出数量&nbsp;: </label>
                        <input type="text" class="form-control"  id = "sellDealNumber_verify" name = "sellDealNumber" data-parsley-required="true"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">卖出价格&nbsp;: </label>
                        <input type="text" class="form-control" id ="sellDealPrice_verify" name = "sellDealPrice" data-parsley-required="true"/>
                    </div>
                </form>
            </div>
            <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="verifyForm" nc-ajax-submit>确认提交</a> </div>
        </div>
    </div>
</div>

<!-- 结束编辑管理员模态窗口 -->

</@list.html>
<!-- ================== 开始页面级JavaScrip调用 ================== -->
<!--复制控件-->
<script src="${jsRoot}copy/clipboard.min.js"></script>
<script src="${pluginsRoot}bootstrap-wizard/js/bwizard.js"></script>
<!-- 表单checkbox项 -->
<script src="${pluginsRoot}bootstrap-switch/bootstrap-switch.min.js"></script>
<!-- 日历控件 -->
<script src="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/WdatePicker.js" defer="defer"></script>
<script src="${jsRoot}myOrder/myOrder.handle.js"></script>
<script>
    var clipboard = new Clipboard('.invite-copy');
    clipboard.on('success', function(e) {

    });
    clipboard.on('error', function(e) {
        alert('复制失败,请手动复制');
    });

</script>
<!-- ================== 结束页面级JavaScrip调用 ================== -->
</@c.html>
